package Code.Test2;

public class GameTest {
    public static void main(String[] args) {
        //创建第一个角色
        Role r1 = new Role("乔峰",100,'男');
        Role r2 = new Role("鸠摩智",100,'女');

        //展示信息
        r1.showRoleInfo();
        r2.showRoleInfo();

        //开始回合制游戏
        while (true){
            //r1攻击r2
            r1.attack(r2);
            if (r2.getBlood() == 0){
                System.out.println(r1.getName()+"ko了"+r2.getName());
                break;
            }

            //r1攻击r2
            r2.attack(r1);
            if (r1.getBlood() == 0){
                System.out.println(r2.getName()+"ko了"+r1.getName());
                break;
            }

        }
    }
}
